import request from '@/utils/request'

// 查询腹透记录列表
export function listDialysis(query) {
  return request({
    url: '/deyu/dialysis/list',
    method: 'get',
    params: query
  })
}

// 查询腹透记录详细
export function getDialysis(id) {
  return request({
    url: '/deyu/dialysis/' + id,
    method: 'get'
  })
}

// 新增腹透记录
export function addDialysis(data) {
  return request({
    url: '/deyu/dialysis',
    method: 'post',
    data: data
  })
}

// 修改腹透记录
export function updateDialysis(data) {
  return request({
    url: '/deyu/dialysis',
    method: 'put',
    data: data
  })
}

// 删除腹透记录
export function delDialysis(id) {
  return request({
    url: '/deyu/dialysis/' + id,
    method: 'delete'
  })
}

// 查询最近一周风险
export function getNearlyAWeekOfRisk(userId) {
  return request({
    url: '/deyu/dialysis/getNearlyAWeekOfRisk/' + userId,
    method: 'get',
  })
}
